package Persistance;

import Persistance.Exceptions.UnableToPredictRankException;

/**
 * intended to provide a means to define a family of filtering algorithms
 * that can be selected on-the-fly at runtime.
 */
public class FilteringAlgorithmContext {

    IFilteringAlgorithmStrategy strategy;

    // Constructor
    public FilteringAlgorithmContext(IFilteringAlgorithmStrategy strategy) {
        this.strategy = strategy;
    }

    public double getPredictionRating(String user, String item) throws UnableToPredictRankException {
        return strategy.getPredictionRating(user,item);
    }

}
